package com.example.newYear.factory.simpleFactory;

//简单工厂类
public class SimpleFactory {
    public Product createProduct(String type)
    {
        Product product = null;
        if(type.equals("A"))
        {
            product = new ConcreteProductA();
        }
        else if(type.equals("B"))
        {
            product = new ConcreteProductB();
        }
        return product;
    }
}
